﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    public class ZhiWeiShiJianAnPaiModel
    {
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        
        private int _Sec;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }

        private int _Sec1;
        [DataMember]
        public int Sec1
        {
            get { return _Sec1; }
            set { _Sec1 = value; }
        }

        private DateTime? _RiQi;
        [DataMember]
        public DateTime? RiQi
        {
            get { return _RiQi; }
            set { _RiQi = value; }
        }

        private string _Zu;
        [DataMember]
        public string Zu
        {
            get { return _Zu; }
            set { _Zu = value; }
        }
        /// <summary>
        /// 上午还是下午
        /// </summary>
        private string _SXWU;
        [DataMember]
        public string SXWU
        {
            get { return _SXWU; }
            set { _SXWU = value; }
        }

        private string _YuanZu;
        [DataMember]
        public string YuanZu
        {
            get { return _YuanZu; }
            set { _YuanZu = value; }
        }

        /// <summary>
        /// 岗位专业ID
        /// </summary>
        private int _PublicOfficialSelectionID;
        [DataMember]
        public int PublicOfficialSelectionID
        {
            get { return _PublicOfficialSelectionID; }
            set { _PublicOfficialSelectionID = value; }
        }

        private int _ZhuKaoGuan;
        [DataMember]
        public int ZhuKaoGuan
        {
            get { return _ZhuKaoGuan; }
            set { _ZhuKaoGuan = value; }
        }

        private int _ZhuanYeKaoGuan1;
        [DataMember]
        public int ZhuanYeKaoGuan1
        {
            get { return _ZhuanYeKaoGuan1; }
            set { _ZhuanYeKaoGuan1 = value; }
        }

        private int _ZhuanYeKaoGuan2;
        [DataMember]
        public int ZhuanYeKaoGuan2
        {
            get { return _ZhuanYeKaoGuan2; }
            set { _ZhuanYeKaoGuan2 = value; }
        }

        private int _DanWeiKaoGuan1;
        [DataMember]
        public int DanWeiKaoGuan1
        {
            get { return _DanWeiKaoGuan1; }
            set { _DanWeiKaoGuan1 = value; }
        }

        private int _DanWeiKaoGuan2;
        [DataMember]
        public int DanWeiKaoGuan2
        {
            get { return _DanWeiKaoGuan2; }
            set { _DanWeiKaoGuan2 = value; }
        }

        private string _MianShiJianDuYuan;
        [DataMember]
        public string MianShiJianDuYuan
        {
            get { return _MianShiJianDuYuan; }
            set { _MianShiJianDuYuan = value; }
        }

        private string _GongZuoRenGuan1;
        [DataMember]
        public string GongZuoRenGuan1
        {
            get { return _GongZuoRenGuan1; }
            set { _GongZuoRenGuan1 = value; }
        }

        private string _GongZuoRenGuan2;
        [DataMember]
        public string GongZuoRenGuan2
        {
            get { return _GongZuoRenGuan2; }
            set { _GongZuoRenGuan2 = value; }
        }

        private DateTime? _StartShi;
        [DataMember]
        public DateTime? StartShi
        {
            get { return _StartShi; }
            set { _StartShi = value; }
        }

        private string _EndShi;
        [DataMember]
        public string EndShi
        {
            get { return _EndShi; }
            set { _EndShi = value; }
        }

        private int _RenShu;
        [DataMember]
        public int RenShu
        {
            get { return _RenShu; }
            set { _RenShu = value; }
        }

        private string _DiDian;
        [DataMember]
        public string DiDian
        {
            get { return _DiDian; }
            set { _DiDian = value; }
        }

        private int _Year;
        [DataMember]
        public int Year
        {
            get { return _Year; }
            set { _Year = value; }
        }



        private string _Duty;
        [DataMember]
        public string Duty
        {
            get { return _Duty; }
            set { _Duty = value; }
        }
        private string _ZhuKaoGuanS;
        [DataMember]
        public string ZhuKaoGuanS
        {
            get { return _ZhuKaoGuanS; }
            set { _ZhuKaoGuanS = value; }
        }
        private string _ZhuanYeKaoGuan1S;
        [DataMember]
        public string ZhuanYeKaoGuan1S
        {
            get { return _ZhuanYeKaoGuan1S; }
            set { _ZhuanYeKaoGuan1S = value; }
        }
        private string _ZhuanYeKaoGuan2S;
        [DataMember]
        public string ZhuanYeKaoGuan2S
        {
            get { return _ZhuanYeKaoGuan2S; }
            set { _ZhuanYeKaoGuan2S = value; }
        }
        private string _DanWeiKaoGuan1S;
        [DataMember]
        public string DanWeiKaoGuan1S
        {
            get { return _DanWeiKaoGuan1S; }
            set { _DanWeiKaoGuan1S = value; }
        }
        private string _DanWeiKaoGuan2S;
        [DataMember]
        public string DanWeiKaoGuan2S
        {
            get { return _DanWeiKaoGuan2S; }
            set { _DanWeiKaoGuan2S = value; }
        }
        private string _Shi;
        [DataMember]
        public string Shi
        {
            get { return _Shi; }
            set { _Shi = value; }
        }

        private string _Type;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
        private DateTime? _ExameDate;
        [DataMember]
        public DateTime? ExameDate
        {
            get { return _ExameDate; }
            set { _ExameDate = value; }
        }
        public static ZhiWeiShiJianAnPaiModel FillEntity(DataRow dr)
        {
            ZhiWeiShiJianAnPaiModel right = new ZhiWeiShiJianAnPaiModel();
            if (!string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = (int)dr["ID"];
            if (!string.IsNullOrEmpty(dr["Year"].ToString())) right.Year = (int)dr["Year"];
            if (!string.IsNullOrEmpty(dr["PublicOfficialSelectionID"].ToString())) right.PublicOfficialSelectionID = (int)dr["PublicOfficialSelectionID"];
            right.Zu = dr["Zu"] as string;
            if (!string.IsNullOrEmpty(dr["ZhuKaoGuan"].ToString())) right.ZhuKaoGuan = (int)dr["ZhuKaoGuan"];
            if (!string.IsNullOrEmpty(dr["ZhuanYeKaoGuan1"].ToString())) right.ZhuanYeKaoGuan1 = (int)dr["ZhuanYeKaoGuan1"];
            if (!string.IsNullOrEmpty(dr["ZhuanYeKaoGuan2"].ToString())) right.ZhuanYeKaoGuan2 = (int)dr["ZhuanYeKaoGuan2"];
            if (!string.IsNullOrEmpty(dr["RenShu"].ToString())) right.RenShu = (int)dr["RenShu"];
            //if (!string.IsNullOrEmpty(dr["RenShu1"].ToString())) right.RenShu1 = (int)dr["RenShu1"];
            if (!string.IsNullOrEmpty(dr["RiQi"].ToString())) right.RiQi = (DateTime?)dr["RiQi"];
            if (!string.IsNullOrEmpty(dr["DanWeiKaoGuan1"].ToString())) right.DanWeiKaoGuan1 = (int)dr["DanWeiKaoGuan1"];
            if (!string.IsNullOrEmpty(dr["DanWeiKaoGuan2"].ToString())) right.DanWeiKaoGuan2 = (int)dr["DanWeiKaoGuan2"];
            right.MianShiJianDuYuan = dr["MianShiJianDuYuan"] as string;
            right.GongZuoRenGuan1 = dr["GongZuoRenGuan1"] as string;
            right.GongZuoRenGuan2 = dr["GongZuoRenGuan2"] as string;
            if (!string.IsNullOrEmpty(dr["StartShi"].ToString())) right.StartShi = Convert.ToDateTime(dr["StartShi"]);
            //if (!string.IsNullOrEmpty(dr["EndShi"].ToString())) right.EndShi = (DateTime?)dr["EndShi"];
            //right.StartShi = dr["StartShi"] as string;
            right.EndShi = dr["EndShi"] as string;
            right.DiDian = dr["DiDian"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("ExameDate")) if (!string.IsNullOrEmpty(dr["ExameDate"].ToString())) right.ExameDate = (DateTime?)dr["ExameDate"];
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) if (!string.IsNullOrEmpty(dr["Sec"].ToString())) right.Sec = Convert.ToInt32(dr["Sec"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Sec1")) if (!string.IsNullOrEmpty(dr["Sec1"].ToString())) right.Sec1 = Convert.ToInt32(dr["Sec1"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Type")) if (!string.IsNullOrEmpty(dr["Type"].ToString())) right.Type = dr["Type"].ToString();
            return right;
        }

        public static ZhiWeiShiJianAnPaiModel FillEntity1(DataRow dr)
        {
            ZhiWeiShiJianAnPaiModel right = new ZhiWeiShiJianAnPaiModel();
            if (!string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = (int)dr["ID"];
            if (!string.IsNullOrEmpty(dr["Sec"].ToString())) right.Sec = Convert.ToInt32(dr["Sec"]);
            if (!string.IsNullOrEmpty(dr["RiQi"].ToString())) right.RiQi = (DateTime?)dr["RiQi"];
            right.Zu = dr["Zu"] as string;
            right.Duty = dr["Duty"] as string;
            right.ZhuKaoGuanS = dr["ZhuKaoGuanS"] as string;
            right.ZhuanYeKaoGuan1S = dr["ZhuanYeKaoGuan1S"] as string;
            right.ZhuanYeKaoGuan2S = dr["ZhuanYeKaoGuan2S"] as string;
            right.DanWeiKaoGuan1S = dr["DanWeiKaoGuan1S"] as string;
            right.DanWeiKaoGuan2S = dr["DanWeiKaoGuan2S"] as string;
            right.MianShiJianDuYuan = dr["MianShiJianDuYuan"] as string;
            right.GongZuoRenGuan1 = dr["GongZuoRenGuan1"] as string;
            right.GongZuoRenGuan2 = dr["GongZuoRenGuan2"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("StartShi") && !string.IsNullOrEmpty(dr["StartShi"].ToString())) right.StartShi = Convert.ToDateTime(dr["StartShi"]);
            //if (!string.IsNullOrEmpty(dr["EndShi"].ToString())) right.EndShi = (DateTime?)dr["EndShi"];
            //right.StartShi = dr["StartShi"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("EndShi") && !string.IsNullOrEmpty(dr["EndShi"].ToString()))
            right.EndShi = dr["EndShi"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("ExameDate")) if (!string.IsNullOrEmpty(dr["ExameDate"].ToString())) right.ExameDate = (DateTime?)dr["ExameDate"];
            if (!string.IsNullOrEmpty(dr["RenShu"].ToString())) right.RenShu = (int)dr["RenShu"];
            right.DiDian = dr["DiDian"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("Type")) if (!string.IsNullOrEmpty(dr["Type"].ToString())) right.Type = dr["Type"].ToString();
            return right;
        }
    }
}
